﻿//-----------------------------------------------------------------------
// <copyright file="UnitTestClassAttribute.cs" company="P.O.S Informatique">
//     Copyright (c) P.O.S Informatique. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace PosInformatique.DevelopmentTools.VisualStudio.TestExtensions
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    /// <summary>
    /// When applied on unit test class allows to run unit test in the
    /// P.O.S Informatique Visual Studio Test Extensions infrastructure.
    /// </summary>
    [Serializable]
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
    public sealed class UnitTestClassAttribute : TestClassExtensionAttribute 
    {
        /// <summary>
        /// Extension ID of the <see cref="UnitTestClassAttribute"/>.
        /// </summary>
        private static readonly Uri ExtensionIdUri = new Uri("urn:PosInformatique.DevelopmentTools.VisualStudio.TestExtensions");

        /// <summary>
        /// Initializes a new instance of the <see cref="UnitTestClassAttribute"/> class.
        /// </summary>
        public UnitTestClassAttribute()
        {
        }

        /// <inheritdoc />
        public override Uri ExtensionId
        {
            get { return ExtensionIdUri; }
        }

        /// <inheritdoc />
        public override TestExtensionExecution GetExecution()
        {
            return new AppDomainTestExtensionExecution();
        }
    }
}
